public class SalarySystemTest {
    public static void main(String[] args) {
        Employee[] employees = new Employee[2];
        employees[0] = new HourlyEmployee("张三", "E001", 50, 160);
        employees[1] = new Manager("李四", "M001", 10000, 5000);

        for (Employee emp : employees) {
            try {
                System.out.println(emp.generateSalarySlip());
            } catch (Exception e) {
                System.out.println("工号：" + emp.empId + "，姓名：" + emp.name + "，薪资计算异常：" + e.getMessage());
            }
        }
    }
}
